package com.hzncc.flowable_diboot.mapper;

import com.hzncc.flowable_diboot.contract.entity.SalesContract;
import com.diboot.core.mapper.BaseCrudMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 销售合同 相关Mapper层接口定义
 *
 * @author MyName
 * @version 1.0
 * @date 2024-09-02
 * Copyright © MyCorp
 */
@Mapper
public interface SalesContractMapper extends BaseCrudMapper<SalesContract> {

    @Select("""
            select * from mdl_sales_contract msc,mdl_contract_product mcp \
            where msc.contract_product_id = mcp.id \
            and (msc.project_contract_id = #{contractId} or mcp.contract_audit_id = #{contractId})
            """)
    List<SalesContract> selectListByContractId(String contractId);
}